
package net.lab0.fractal.gui;


import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.UIManager;
import javax.swing.border.TitledBorder;


@SuppressWarnings("serial")
public class MandelbrotTreeComputationPanel
extends JPanel
{
    private final JPanel                          panel                           = new JPanel();
    private final JPanel                          panel_1                         = new JPanel();
    private final JPanel                          panel_2                         = new JPanel();
    private final JPanel                          panel_3                         = new JPanel();
    private final JPanel                          panel_4                         = new JPanel();
    private final JButton                         btnStart                        = new JButton("Start");
    private final JButton                         btnPause                        = new JButton("Pause");
    private final JPanel                          panel_5                         = new JPanel();
    private final JCheckBox                       chckbxMultiprocessor            = new JCheckBox("Multiprocessor");
    private final JCheckBox                       chckbxCpu                       = new JCheckBox("CPU");
    private final JLabel                          lblThreads                      = new JLabel("Threads");
    private final JSpinner                        spinner                         = new JSpinner();
    private final JCheckBox                       chckbxGPU                       = new JCheckBox("GPU");
    private final JPanel                          pnlStatus                       = new JPanel();
    private final JCheckBox                       chckbxIndepedant                = new JCheckBox("Global TPE");
    private final JPanel                          panel_6                         = new JPanel();
    private final JLabel                          lblIterations                   = new JLabel("Iterations");
    private final JLabel                          label                           = new JLabel("2^");
    private final JSpinner                        spinner_1                       = new JSpinner();
    private final JLabel                          lblMaxDepth                     = new JLabel("Max depth");
    private final JSpinner                        spinner_2                       = new JSpinner();
    private final JLabel                          lblStopDepth                    = new JLabel("Stop depth");
    private final JSpinner                        spinner_3                       = new JSpinner();
    
    public MandelbrotTreeComputationPanel()
    {
        initComponents();
    }
    
    private void initComponents()
    {
        setLayout(new BorderLayout(0, 0));
        
        add(panel, BorderLayout.WEST);
        GridBagLayout gbl_panel = new GridBagLayout();
        gbl_panel.columnWidths = new int[] { 0, 0 };
        gbl_panel.rowHeights = new int[] { 0, 0, 0 };
        gbl_panel.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
        gbl_panel.rowWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
        panel.setLayout(gbl_panel);
        
        GridBagConstraints gbc_panel_2 = new GridBagConstraints();
        gbc_panel_2.insets = new Insets(0, 0, 5, 0);
        gbc_panel_2.fill = GridBagConstraints.BOTH;
        gbc_panel_2.gridx = 0;
        gbc_panel_2.gridy = 0;
        panel_2.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Computation", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
        panel.add(panel_2, gbc_panel_2);
        GridBagLayout gbl_panel_2 = new GridBagLayout();
        gbl_panel_2.columnWidths = new int[] { 0, 0, 0 };
        gbl_panel_2.rowHeights = new int[] { 0, 0, 0, 0, 0 };
        gbl_panel_2.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
        gbl_panel_2.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
        panel_2.setLayout(gbl_panel_2);
        
        GridBagConstraints gbc_btnStart = new GridBagConstraints();
        gbc_btnStart.gridwidth = 2;
        gbc_btnStart.fill = GridBagConstraints.HORIZONTAL;
        gbc_btnStart.insets = new Insets(0, 0, 5, 0);
        gbc_btnStart.gridx = 0;
        gbc_btnStart.gridy = 0;
        panel_2.add(btnStart, gbc_btnStart);
        
        GridBagConstraints gbc_btnPause = new GridBagConstraints();
        gbc_btnPause.gridwidth = 2;
        gbc_btnPause.fill = GridBagConstraints.HORIZONTAL;
        gbc_btnPause.insets = new Insets(0, 0, 5, 0);
        gbc_btnPause.gridx = 0;
        gbc_btnPause.gridy = 1;
        btnPause.setEnabled(false);
        panel_2.add(btnPause, gbc_btnPause);
        
        GridBagConstraints gbc_panel_5 = new GridBagConstraints();
        gbc_panel_5.gridwidth = 2;
        gbc_panel_5.insets = new Insets(0, 0, 5, 0);
        gbc_panel_5.fill = GridBagConstraints.BOTH;
        gbc_panel_5.gridx = 0;
        gbc_panel_5.gridy = 2;
        panel_5.setBorder(new TitledBorder(null, "Multithreading", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_2.add(panel_5, gbc_panel_5);
        GridBagLayout gbl_panel_5 = new GridBagLayout();
        gbl_panel_5.columnWidths = new int[] { 24, 0, 50, 0 };
        gbl_panel_5.rowHeights = new int[] { 0, 0, 0, 0, 0, 0 };
        gbl_panel_5.columnWeights = new double[] { 1.0, 1.0, 0.0, Double.MIN_VALUE };
        gbl_panel_5.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
        panel_5.setLayout(gbl_panel_5);
        
        GridBagConstraints gbc_chckbxMultiprocessor = new GridBagConstraints();
        gbc_chckbxMultiprocessor.fill = GridBagConstraints.HORIZONTAL;
        gbc_chckbxMultiprocessor.insets = new Insets(0, 0, 5, 0);
        gbc_chckbxMultiprocessor.gridwidth = 3;
        gbc_chckbxMultiprocessor.gridx = 0;
        gbc_chckbxMultiprocessor.gridy = 0;
        panel_5.add(chckbxMultiprocessor, gbc_chckbxMultiprocessor);
        
        GridBagConstraints gbc_chckbxCpu = new GridBagConstraints();
        gbc_chckbxCpu.anchor = GridBagConstraints.WEST;
        gbc_chckbxCpu.gridwidth = 2;
        gbc_chckbxCpu.insets = new Insets(0, 0, 5, 0);
        gbc_chckbxCpu.gridx = 1;
        gbc_chckbxCpu.gridy = 1;
        chckbxCpu.setEnabled(false);
        panel_5.add(chckbxCpu, gbc_chckbxCpu);
        
        GridBagConstraints gbc_chckbxGPU = new GridBagConstraints();
        gbc_chckbxGPU.anchor = GridBagConstraints.WEST;
        gbc_chckbxGPU.insets = new Insets(0, 0, 5, 0);
        gbc_chckbxGPU.gridwidth = 2;
        gbc_chckbxGPU.gridx = 1;
        gbc_chckbxGPU.gridy = 2;
        chckbxGPU.setEnabled(false);
        panel_5.add(chckbxGPU, gbc_chckbxGPU);
        
        GridBagConstraints gbc_chckbxIndepedant = new GridBagConstraints();
        gbc_chckbxIndepedant.insets = new Insets(0, 0, 5, 0);
        gbc_chckbxIndepedant.anchor = GridBagConstraints.WEST;
        gbc_chckbxIndepedant.gridwidth = 2;
        gbc_chckbxIndepedant.gridx = 1;
        gbc_chckbxIndepedant.gridy = 3;
        chckbxIndepedant.setEnabled(false);
        chckbxIndepedant.setSelected(true);
        panel_5.add(chckbxIndepedant, gbc_chckbxIndepedant);
        
        GridBagConstraints gbc_lblThreads = new GridBagConstraints();
        gbc_lblThreads.insets = new Insets(0, 0, 0, 5);
        gbc_lblThreads.gridx = 1;
        gbc_lblThreads.gridy = 4;
        lblThreads.setEnabled(false);
        panel_5.add(lblThreads, gbc_lblThreads);
        
        GridBagConstraints gbc_spinner = new GridBagConstraints();
        gbc_spinner.fill = GridBagConstraints.HORIZONTAL;
        gbc_spinner.gridx = 2;
        gbc_spinner.gridy = 4;
        spinner.setEnabled(false);
        spinner.setModel(new SpinnerNumberModel(2, 1, Runtime.getRuntime().availableProcessors(), 1));
        panel_5.add(spinner, gbc_spinner);
        
        GridBagConstraints gbc_lblStopDepth = new GridBagConstraints();
        gbc_lblStopDepth.insets = new Insets(0, 0, 0, 5);
        gbc_lblStopDepth.anchor = GridBagConstraints.WEST;
        gbc_lblStopDepth.gridx = 0;
        gbc_lblStopDepth.gridy = 3;
        panel_2.add(lblStopDepth, gbc_lblStopDepth);
        
        GridBagConstraints gbc_spinner_3 = new GridBagConstraints();
        gbc_spinner_3.fill = GridBagConstraints.HORIZONTAL;
        gbc_spinner_3.gridx = 1;
        gbc_spinner_3.gridy = 3;
        panel_2.add(spinner_3, gbc_spinner_3);
        
        GridBagConstraints gbc_panel_3 = new GridBagConstraints();
        gbc_panel_3.fill = GridBagConstraints.BOTH;
        gbc_panel_3.gridx = 0;
        gbc_panel_3.gridy = 1;
        panel_3.setBorder(new TitledBorder(null, "Parameters", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel.add(panel_3, gbc_panel_3);
        GridBagLayout gbl_panel_3 = new GridBagLayout();
        gbl_panel_3.columnWidths = new int[] { 0, 0, 50, 0 };
        gbl_panel_3.rowHeights = new int[] { 0, 0, 0, 0 };
        gbl_panel_3.columnWeights = new double[] { 0.0, 0.0, 1.0, Double.MIN_VALUE };
        gbl_panel_3.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
        panel_3.setLayout(gbl_panel_3);
        
        GridBagConstraints gbc_lblIterations = new GridBagConstraints();
        gbc_lblIterations.insets = new Insets(0, 0, 5, 10);
        gbc_lblIterations.gridx = 0;
        gbc_lblIterations.gridy = 0;
        panel_3.add(lblIterations, gbc_lblIterations);
        
        GridBagConstraints gbc_label = new GridBagConstraints();
        gbc_label.insets = new Insets(0, 0, 5, 5);
        gbc_label.gridx = 1;
        gbc_label.gridy = 0;
        panel_3.add(label, gbc_label);
        
        GridBagConstraints gbc_spinner_1 = new GridBagConstraints();
        gbc_spinner_1.fill = GridBagConstraints.HORIZONTAL;
        gbc_spinner_1.insets = new Insets(0, 0, 5, 0);
        gbc_spinner_1.gridx = 2;
        gbc_spinner_1.gridy = 0;
        spinner_1.setModel(new SpinnerNumberModel(10, 6, 63, 1));
        panel_3.add(spinner_1, gbc_spinner_1);
        
        GridBagConstraints gbc_lblMaxDepth = new GridBagConstraints();
        gbc_lblMaxDepth.insets = new Insets(0, 0, 5, 5);
        gbc_lblMaxDepth.gridx = 0;
        gbc_lblMaxDepth.gridy = 1;
        panel_3.add(lblMaxDepth, gbc_lblMaxDepth);
        
        GridBagConstraints gbc_spinner_2 = new GridBagConstraints();
        gbc_spinner_2.fill = GridBagConstraints.HORIZONTAL;
        gbc_spinner_2.gridwidth = 2;
        gbc_spinner_2.insets = new Insets(0, 0, 5, 0);
        gbc_spinner_2.gridx = 1;
        gbc_spinner_2.gridy = 1;
        spinner_2.setModel(new SpinnerNumberModel(64, 4, 65536, 1));
        panel_3.add(spinner_2, gbc_spinner_2);
        
        add(panel_1, BorderLayout.SOUTH);
        GridBagLayout gbl_panel_1 = new GridBagLayout();
        gbl_panel_1.columnWidths = new int[] { 0, 0, 0 };
        gbl_panel_1.rowHeights = new int[] { 0, 0, 0 };
        gbl_panel_1.columnWeights = new double[] { 1.0, 1.0, Double.MIN_VALUE };
        gbl_panel_1.rowWeights = new double[] { 1.0, 1.0, Double.MIN_VALUE };
        panel_1.setLayout(gbl_panel_1);
        
        GridBagConstraints gbc_panel_4 = new GridBagConstraints();
        gbc_panel_4.insets = new Insets(0, 0, 5, 5);
        gbc_panel_4.fill = GridBagConstraints.BOTH;
        gbc_panel_4.gridx = 0;
        gbc_panel_4.gridy = 0;
        panel_4.setBorder(new TitledBorder(null, "Informations", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_1.add(panel_4, gbc_panel_4);
        GridBagLayout gbl_panel_4 = new GridBagLayout();
        gbl_panel_4.columnWidths = new int[] { 0 };
        gbl_panel_4.rowHeights = new int[] { 0 };
        gbl_panel_4.columnWeights = new double[] { Double.MIN_VALUE };
        gbl_panel_4.rowWeights = new double[] { Double.MIN_VALUE };
        panel_4.setLayout(gbl_panel_4);
        
        GridBagConstraints gbc_panel_6 = new GridBagConstraints();
        gbc_panel_6.insets = new Insets(0, 0, 5, 0);
        gbc_panel_6.fill = GridBagConstraints.BOTH;
        gbc_panel_6.gridx = 1;
        gbc_panel_6.gridy = 0;
        panel_6.setBorder(new TitledBorder(null, "Events", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panel_1.add(panel_6, gbc_panel_6);
        
        GridBagConstraints gbc_pnlStatus = new GridBagConstraints();
        gbc_pnlStatus.insets = new Insets(0, 0, 0, 5);
        gbc_pnlStatus.fill = GridBagConstraints.BOTH;
        gbc_pnlStatus.gridx = 0;
        gbc_pnlStatus.gridy = 1;
        panel_1.add(pnlStatus, gbc_pnlStatus);
        GridBagLayout gbl_pnlStatus = new GridBagLayout();
        gbl_pnlStatus.columnWidths = new int[] { 0 };
        gbl_pnlStatus.rowHeights = new int[] { 0 };
        gbl_pnlStatus.columnWeights = new double[] { Double.MIN_VALUE };
        gbl_pnlStatus.rowWeights = new double[] { Double.MIN_VALUE };
        pnlStatus.setLayout(gbl_pnlStatus);
    }
    
}
